package service

import (
	"sbd_zgqx/models"
	"sbd_zgqx/reposit"
)

type WeatherService struct {
	Repo reposit.WeatherReposit
}

func (srv *WeatherService) ListArea() ([]models.Province, error) {
	return srv.Repo.ListArea()
}

func (srv *WeatherService) InsertWeather(weather models.Weather) (bool, error) {
	is, err := srv.Repo.IsLoadWeather(weather)
	if err != nil {
		return is, err
	}
	return srv.Repo.InsertWeather(weather)
}
